<?php
/**
 *
 *
 */
interface Yz_Controller_Interface
{

    /** execute the controller's GET method handler with arguments from Request-URI
     *  A string $name can be returned, which is a command for router to execute a controller
     *      with that $name from the same module
     *  Returning false commands to restart controller selection from arguments
     *  @param Yz_Array args
     *  @return chainable|string|false
     */
    public function doGet(
        Yz_Array $args
    );

    /** execute the controller's POST method handler, also supplying a hash of POST arguments
     *  @see doGet
     *  @param Yz_Array args
     *  @param Yz_Hash post-data
     *  @return chainable|string|false
     */
    public function doPost(
        Yz_Array $args,
        Yz_Hash $post
    );

    /** execute the controller's error handler
     *      returning false means error not handled, proceed to next handler
     *  @param Yz_Array args
     *  @param Yz_Exception $ex
     *  @return chainable|false
     */
    public function doError(
        Yz_Exception $ex
    );

}
